package org.gry.dy20180711;

public class TestOperator03 {

	public static void main(String[] args) {
		boolean b1 = true;
		boolean b2 = false;
		System.out.println(b1&b2);			
		System.out.println(b1|b2);			
		System.out.println(b1^b2);			
		System.out.println(!b2);	
		
		//int c =3/0;
		boolean b3 = 1>2&&2<(3/0);//短路了
		System.out.println(b3);
		
		int a = 3;
		int b = 4;
		System.out.println(a&b);
		System.out.println(a|b);
		System.out.println(a^b);
		System.out.println(~a);
	
		int c =3<<2;//相当于乘4，左移1位相当于乘2
		System.out.println(c);
		System.out.println(12>>1);
		
		String a1 = "3";
		int b4 = 4;
		int b5 = 5;
		System.out.println(a1+b4+b5);//看到a1是字符串则a1+b4是字符串，相加后又和b5连接
		System.out.println(b4+b5+a1);//b4和b5是int类型则相加，相加后看到a1是字符串则连接
		
		
	}

}
